-- GENERATED SPELL FOR [Algalon the Observer] --


function spell0_32871(pUnit, Event) --@Ascend to the Heavens,Self--
pUnit:FullCastSpellOnTarget(64487,pUnit)
pUnit:RegisterEvent('Sorts_32871', 2000, 1)
end

function spell1_32871(pUnit, Event) --@Big Bang,Self--
pUnit:FullCastSpellOnTarget(64443,pUnit)
pUnit:RegisterEvent('Sorts_32871', 8000, 1)
end

function spell2_32871(pUnit, Event) --@Big Bang,Self--
pUnit:FullCastSpellOnTarget(64584,pUnit)
pUnit:RegisterEvent('Sorts_32871', 8000, 1)
end

function spell3_32871(pUnit, Event) --@Cosmic Smash,n/a--
pUnit:FullCastSpellOnTarget(62301,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32871', 637, 1)
end

function spell4_32871(pUnit, Event) --@Cosmic Smash,n/a--
pUnit:FullCastSpellOnTarget(64598,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32871', 534, 1)
end

function spell5_32871(pUnit, Event) --@Phase Punch,n/a--
pUnit:FullCastSpellOnTarget(64412,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32871', 45000, 1)
end

function spell6_32871(pUnit, Event) --@Quantum Strike,n/a--
pUnit:FullCastSpellOnTarget(64395,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32871', 609, 1)
end

function spell7_32871(pUnit, Event) --@Quantum Strike,n/a--
pUnit:FullCastSpellOnTarget(64592,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32871', 541, 1)
end

function Sorts_32871(pUnit, Event)
local choix_sorts_32871 = math.random(0, 7)
if choix_sorts_32871 == 0 then
pUnit:RegisterEvent('spell0_32871', 1, 1)
end
if choix_sorts_32871 == 1 then
pUnit:RegisterEvent('spell1_32871', 1, 1)
end
if choix_sorts_32871 == 2 then
pUnit:RegisterEvent('spell2_32871', 1, 1)
end
if choix_sorts_32871 == 3 then
pUnit:RegisterEvent('spell3_32871', 1, 1)
end
if choix_sorts_32871 == 4 then
pUnit:RegisterEvent('spell4_32871', 1, 1)
end
if choix_sorts_32871 == 5 then
pUnit:RegisterEvent('spell5_32871', 1, 1)
end
if choix_sorts_32871 == 6 then
pUnit:RegisterEvent('spell6_32871', 1, 1)
end
if choix_sorts_32871 == 7 then
pUnit:RegisterEvent('spell7_32871', 1, 1)
end
end

function mob32871_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_32871', math.random(1500, 3000), 1)
end

function mob32871_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32871_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32871_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(32871, 1, 'mob32871_Action')
RegisterUnitEvent(32871, 2, 'mob32871_Leave')
RegisterUnitEvent(32871, 3, 'mob32871_Kill')
RegisterUnitEvent(32871, 4, 'mob32871_Die')
